﻿using Ode.Net.Collision;
using Ode.Net;

namespace Painter3D.PhysicalSys
{
    /// <summary>
    /// 物理引擎中物体碰撞器的抽象
    /// </summary>
    abstract class Collision : Component
    {
        /// <summary>
        /// 碰撞箱
        /// </summary>
        public Geom collisionShape;

        protected Collision(Transform transform) : base(transform)
        {
            
        }

        public override void Init()
        {
            base.Init();
            RigidBody rigidBody = transform.GetComponent<RigidBody>();
            if (rigidBody != null)
            {
                collisionShape.Body = rigidBody.body;
            }
        }
    }
}
